<p>
  <span *ngFor="let star of stars" class="glyphicon glyphicon-star" [class.glyphicon-star-empty]="star"></span>

  <!--class.:说明我们绑定的属性是样式.如果'star'为true, glyphicon-star-empty就会出现在class属性中-->

  <span>{{rating}}星</span>
</p>
